package cn.edu.sdjzu.xg.bysj.domain;

import cn.edu.sdjzu.xg.bysj.security.Actor;
import cn.edu.sdjzu.xg.bysj.util.IdService;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Calendar;

public final class Student extends Actor
		implements Comparable<Student>, Serializable {
	private Integer id;
	private String name;
	private String no;
	private Boolean sex;
	private LocalDate birthdate;
	private StudentClass studentClass;
	//导师
	private Teacher supervisor;

	public Student(String name, String no, Boolean sex, LocalDate birthdate, StudentClass studentClass) {
		this.name = name;
		this.no = no;
		this.sex = sex;
		this.birthdate = birthdate;
		this.studentClass = studentClass;
	}

	public Student(Integer id, String name, String no, Boolean sex, LocalDate birthdate, StudentClass studentClass) {
		this.id = id;
		this.name = name;
		this.no = no;
		this.sex = sex;
		this.birthdate = birthdate;
		this.studentClass = studentClass;
	}

	public Student(Integer id, String name, String no, Boolean sex, LocalDate birthdate, StudentClass studentClass, Teacher supervisor) {
		this(id, name, no, sex, birthdate, studentClass);
		this.supervisor = supervisor;
	}

	public Boolean getSex() {
		return sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	public LocalDate getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(LocalDate birthdate) {
		this.birthdate = birthdate;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}


	public StudentClass getStudentClass() {
		return studentClass;
	}

	public Teacher getSupervisor() {
		return supervisor;
	}

	public void setSupervisor(Teacher supervisor) {
		this.supervisor = supervisor;
	}

	public void setStudentClass(StudentClass studentClass) {
		this.studentClass = studentClass;
	}

	@Override
	public String toString() {
		return "Student{" +
				"id=" + id +
				", name='" + name + '\'' +
				", no='" + no + '\'' +
				", sex=" + sex +
				", birthdate=" + birthdate +
				", studentClass=" + studentClass +
				", supervisor=" + supervisor +
				'}';
	}



	@Override
	public int compareTo(Student other) {
		// no为排序依据
		return this.no.compareTo(other.no);
	}
}
